
<template>
	<el-dialog width="800px" visible :show-close="false" :modal-append-to-body="false" class="wrap" size="tiny">
		 <div class="bt">退学</div>
		<i class="el-icon-close close" @click="cancel" style="color: white;"></i>
		<el-form label-width="100px" class="form">
			<el-form-item label="学生名称">
				  <el-input v-model="form.zwm"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="班级名称">
				  <el-input v-model="form.bjmc"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="休课办理时间">
				  <el-input v-model="form.blsj"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="休课开始时间">
				  <el-input v-model="form.kssj"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="休课结束时间">
				  <el-input v-model="form.jssj"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="休课原因">
				 <el-input type="textarea"  :rows="2"  v-model="form.note"  icon="info" class="select-block" ></el-input>
			</el-form-item>
			<el-form-item label="办理人">
				  <el-input v-model="form.blr"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="上课时间">
				  <el-input v-model="form.sksj"  icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="上课办理人">
				  <el-input v-model="form.skblr"  icon="info" class="select-block"></el-input>
			</el-form-item>
		</el-form>
        <BqComponent v-if="portComponents.bq.toggle" @close="componentsHide" :params="portComponents.bq.params"></BqComponent>
		
		<el-button type="primary" class="submit" @click="cancel">确定</el-button>
	</el-dialog>
</template>

<script type="text/javascript">
	import qs from 'qs'
 	import BqComponent from '../../admin/xxjbszManage/bq'
	export default {
 		components: { BqComponent},
		
		props: ['params'],
		data() {
			return {
				bqList:[],
				form: {
					zwm:'',
					bjmc:'',
					blr:'',
					jssj:'',
					kssj:'',
					note:'',
					blsj:'',
				},
				id:'',
				portComponents: {

                    bq: {
                        type: 'bq',
                        toggle: false,
                        params: '',
                        data: {}
                    }

                },
			}
		},
		created() {
			console.log(this.params.row)
            this.id=this.params.row.xxjlid;
            this.loadinfo()
		},
		methods: {
			loadinfo(){
				this.$store.state.loading = true;
				 var logininfo = JSON.parse(localStorage.logininfo) ;
				 var params3 = qs.stringify({
				  	 id:this.id,
					 yhid:logininfo.id,
					 xxid:logininfo.xxid,
				});

				 this.axios.post(this.$store.state.api+'xxjl/info',params3)
				 .then( res =>  {
				 	console.log(res,66)
				 	this.form = res.data.data
					        this.$store.state.loading = false;
					}).catch(res => {
						 this.$message.warning("服务器异常");
					        this.$store.state.loading = false;
					})
			},
			cancel() {
				this.$emit('close', { type: 'info', cancel: true })
			},
			componentsShow (type,data) { //显示组件
                console.log(type,data)
                for ( let i in this.portComponents ) {
                    if (type == this.portComponents[i].type) {
                        this.portComponents[i].toggle = true;
                        this.portComponents[i].params = data;
                        if (this.portComponents[i].data.type == 'single') {
                            this.portComponents[i].data.index = data.row.id
                        }else if(this.portComponents[i].data.type == 'multiple'){
                            this.portComponents[i].data.index = this.multipleDelNum;
                        }else{
                            return;
                        }
                        return;
                    }
                }
            },
 			componentsHide (setting) { //关闭组件
                for ( let i in this.portComponents ) {
                    if (setting.type == this.portComponents[i].type) {
                       this.portComponents[i].toggle = false;
                       if (this.portComponents[i].type=='bq'){
                       	  if (!setting.cancel) {
                       	     for ( let b in setting.clist ) {
                        	 this.bqList.push( setting.clist[b]);
                          }
                       	  }
                       }else{
                        if (!setting.cancel) {
                        }
                       }
                       return;
                    }
                }
            }
		}
	}
</script>

<style lang="less" scoped>
	.wrap {
		text-align: center;
	}
	.bt{
			position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top:0;
			left:0;
			background: #50BFFF;
			margin-bottom: 20px;
			color:white;
			text-align:left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
	.form {
		text-align: left;
		margin-top: 15px;
	}
	.select-block {
		display: block;
		width: 90%;
	}

	.submit {
		width: 120px;
	}
</style>
